<% content_for :page_title do %>
  <%= plural_resource_name(Spree::StoreCreditCategory) %>
<% end %>

<% content_for :page_actions do %>
  <%= render_admin_partials(:store_credit_categories_actions_partials) %>
  <%= link_to_with_icon 'plus', Spree.t(:new_store_credit_category), new_object_url, class: "btn btn-primary" %>
<% end if can? :create, Spree::StoreCreditCategory %>

<%= render_admin_partials(:store_credit_categories_header_partials) %>

<div class="card-lg">
  <% if @collection.any? %>
    <div class="table-responsive">
      <table class="table">
        <thead>
          <tr>
            <th scope="col"><%= sort_link @search, :name, Spree.t(:name) %></th>
            <th scope="col"></th>
          </tr>
        </thead>
        <tbody>
          <% @collection.each do |store_credit_category| %>
            <tr id="<%= spree_dom_id store_credit_category %>">
              <td>
                <%= store_credit_category.name %>
              </td>
              <td class="actions">
                <%= link_to_edit(store_credit_category, no_text: true, data: { turbo_frame: '_top' }) if can? :edit, store_credit_category %>
              </td>
            </tr>
          <% end %>
        </tbody>
      </table>
    </div>
  <% else %>
    <%= render 'spree/admin/shared/no_resource_found' %>
  <% end %>
</div>
